<template>
  <div class="cates">
    <van-tabs @click="tabClick" color="#7744FF" background="#ccc">
      <van-tab
        v-for="item in cates"
        :key="item.id"
        :title="item.catename"
        :name="item.id"
      >
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
export default {
  props: ["cates"],
  methods: {
    tabClick(e) {
      this.$router.push("/list?id=" + e + "&type=1");
    },
  },
};
</script>

<style scoped lang="less">
@import "../../../less/index.less";
.cates {
  overflow: hidden;
  a {
    float: left;
    margin: @margin20;
  }
}

a {
  display: inline-block;
  margin: @margin20;
}
</style>